package com.ouc.entity;

import lombok.Data;

/**
 * @Name: Rectangle
 * @Description: 长方形
 * @Author: Mr.Tong
 */
@Data
public class Rectangle extends Shape {
    //长
    private Double height;
    //宽
    private Double width;

    @Override
    public Double perimeter() {
        return 2*(height+width);
    }

    @Override
    public Double area() {
        return height*width;
    }

    @Override
    public Integer unitAreaPrice() {
        return ShapeType.UNITAREAPRICE.get(2);
    }
}
